Amazon HealthLake System API - Implementation Template
Developer guide
This document provides information generated from the DataWeave scripts included in the project, such as function definitions, variable definitions, and data mapping tables.
| Module | Description |
|---|---|
| FhirTools | This module defines a number of common FHIR utility functions. |
FhirTools
This module defines a number of common
FHIR utility functions.
Source:
./src/main/resources/dwl/FhirTools.dwl
Functions
fun getPatientId (data)
Gets the first Patient ID from the search result set.
return A string with the Patient ID or an empty string.
fun getPractitionerId (data)
Gets the first Practitioner ID from the search result set.
return A string with the Practitioner ID or an empty string.
fun getPatient (data)
Gets the FHIR patient data structure with the provided FHIR bundle.
param
datais the FHIR bundle to get the patient from.
return A FHIR Patient resource or null if not found.
fun getPractitioners (data)
Gets a list of FHIR Practitioner objects with the provided FHIR bundle.
param
datais the FHIR bundle to get the practitioners from.
return A list of FHIR Practitioner objects or empty list
fun getMrnNumber (data)
Gets the Patient MRN number with the provided FHIR bundle. If no MRN number can be found it returns the value of the first identifier or a blank string.
param
datais the FHIR bundle to get the MRN from.
return A String with the MRN number or an empty string if not found.
fun getResourceMrnNumber (resourceData)
Gets the Resource(Ex: Patient, Practitioner etc..) MRN number with the provided FHIR request. If no MRN number can be found it returns the value of the first identifier or a blank string.
param
resourceDatais the FHIR request to get the MRN from.
return A String with the MRN number or an empty string if not found.
fun getPractitionerIdNumbers (data, practitionerIdSystemList)
Gets the Practitioner ID numbers with the provided FHIR bundle.
param
datais the FHIR bundle to get the NPIs from.
parampractitionerIdSystemListis a list of strings with the systems to use to match the Practitioner unique identifier.
return A list with the Practitioner ID numbers or an empty list if not found. Each entry in the list is an array with the first item being the identifier found and the second being the resource id value.
fun createBundleRequest (data, patientId)
Creates the bundle request with the provided FHIR bundle and patient ID. This function also updates all Patient and Practitioner references.
param
datais the current FHIR bundle request.
parampatientIdwith the new patient ID to use in the request.
return A formatted bundle request ready to send to HealthLake.
fun updatePractitionerId (data, srcPractitionerId, destPractitionerId)
Updates the provided bundle with the provided source and destination Practitioner Ids.
param
datais the bundle to upadte.
paramsrcPractitionerIdis the source practitioner ID to look for.
paramdestPractitionerIdis the destination practitioner ID to replace with.
return A bundle with updated Practitioner Ids.
fun updatePractitionerIdRefs (data, srcPractitionerId, destPractitionerId)
Updates all references in the provided bundle with the provided source and destination Practitioner IDs.
param
datais the bundle to upadte.
paramsrcPractitionerIdis the source practitioner ID to look for.
paramdestPractitionerIdis the destination practitioner ID to replace with.
return A bundle with updated Practitioner Ids.
fun processBundle (data, patientId)
Creates the bundle request with the provided FHIR bundle and patient ID.
param
datais the current FHIR bundle request.
parampatientIdwith the new patient ID to use in the request.
return A formatted bundle request ready to send to HealthLake.
fun updateEntryMethods (data)
Updates all entries in the bundle to method PUT and remove fullUrl because it causes issues updating in HealthLake. If the request section wasn't found it will add it.
param
datais the current FHIR bundle request.
return A FHIR bundle request with all of the entry methods set to POST.
fun updatePatientId (entries, patientId)
Updates the patient ID in the provided list of entries with the provided patient ID. This function only updates the IDs in the actual Patient record, not all of the other references.
param
entriesis a list of entries from the bundle.
parampatientIdis a string with the new patient ID to update to.
return A list of entries with the updated patient record.